<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="cn.ac.cintcm.dataconverge.researcher.domain.SystemDict,java.util.*,com.hs.core.page.PageUtil,com.hs.core.utils.*" %>
<%@ page import="cn.ac.cintcm.dataconverge.util.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

PageUtil pageUtil = (PageUtil)request.getAttribute("pageUtil");
String pageStr = ""; 
int perpageCount = 1;
int currentPage = 1;
List list = null;
if(null != pageUtil){
   list = pageUtil.getPageList();
   pageStr = pageUtil.getPageStr();
   perpageCount = pageUtil.getNumberPerPage();
   currentPage = pageUtil.getCurrentPage();
}  
String orderName = (String)request.getAttribute("orderName");
String orderNum = (String)request.getAttribute("orderNum"); 
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<TITLE>文件类型管理</TITLE>
  	 <link href="<%=basePath%>index/Themes/com/style.css" rel="stylesheet" type="text/css" />
    <script src="<%=basePath%>index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
     <script src="<%=basePath%>js/common.js" language="javascript" type="text/javascript"></script>
	<SCRIPT type="text/javascript">
	function modifyUser(value) {
	        //var bln = window.confirm("确定要修改吗？", "确定", "取消");
	        //if(bln == true) {
	       // var page=document.all.ec_p.value; 
			url = "systemDict.htm?action=tomodify&flag=mod&id=" + value+"&dictType=1";
			openwindow(url,'400','150');
			//}
		}
	
	function changeState(value) {
		var bln = window.confirm("确定要删除此文件类型吗？", "确定", "取消");
		if(bln == true) { 
			url = "systemDict.htm?action=delete&id=" + value+"&dictType=1";
			document.location.href = url;
		}
	}
	</SCRIPT>
</head>
  
<body  scroll="yes">
      <div class="r_rtm_tb_mg1">
        <div class="r_rtm_tb1">
            <img src="<%=basePath%>index/Themes/com/idt_tb_pass.gif" />&nbsp;文件类型管理
        </div>
    </div>
     <table cellspacing="2" cellpadding="0" width="100%" class="idt_item_mg" id="Table2">
     <tbody><form name="searchform" action="systemDict.htm?action=list&dictType=1" method="post">
        <tr>
		<td class="fim_l">  文件类型:</td>
            <td class="fim_r">
                <input type="text" class="com_textbox" id="name" name="name" value="<%=StringUtilTool.setObjNULLStr(request.getAttribute("name")) %>"></td>
            <td class="fim_r" align="right" colspan="2">
                <input type="submit" value="查询" name="B3" class="com_btn2" id="Button5">
                 <%if(AuthCheck.isHasAuth(request,Constants.AUTHMETHOD_DICT_ADD)){ %>
                <input type="button" value="添加" name="B4" class="com_btn2" id="Button2" onclick="javascript:openwindow('systemDict.htm?action=tomodify&flag=add&dictType=1','400','150');">
			    <%} %>
            </td>
        </tr></form></tbody>
    </table>
    <div class="content">
        <table width="*" cellpadding="0" cellspacing="1" class="dg_borderstyle" id="Table4" >
            <tr>
                <td class="dg_headerstyle">
                    序号</td>
                <td class="dg_headerstyle" >
                   <a href="javaScript:orderPage('name','<%=OrderTool.getOrderNum("name",orderName,orderNum)%>');">文件类型&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("name",orderName,orderNum))%></a></td>
                <td class="dg_headerstyle">编辑</td>
                 <td class="dg_headerstyle">删除</td>
            </tr>
            <% 
             if(list != null && list.size()>0){
              	for(int i = 0;i<list.size();i++){
            	 	SystemDict systemDict= (SystemDict)list.get(i);
            Iterator iterator = list.iterator(); 
            
            %>
            <tr class="dg_alternatingitemstyle" onmouseover="ChangeRowBg(this);" onmouseout="ChangeRowBg(this);" onmouseup="ChangeRowBg(this);" onmousedown="ChangeRowBg(this);">
                 <td align="center" width="5%">
                     <%= perpageCount*(currentPage-1)+i+1 %></td>
                <td>
                    <%=systemDict.getName() %>
                </td>
                <td align="center"> <%if(AuthCheck.isHasAuth(request,Constants.AUTHMETHOD_DICT_MOD)){ %>
                <img style="cursor: hand" src="<%=basePath%>index/Themes/com/68design.net_registration1_(edit)_16x16.gif" onclick="javascript:modifyUser('<%=systemDict.getId() %>');"
                                    alt="编辑" /><%} %>
                <td align="center">
                 <%if(AuthCheck.isHasAuth(request,Constants.AUTHMETHOD_DICT_DEL)){ %>
                <img style="cursor: hand" src="<%=basePath%>index/Themes/com/68design.net_registration1_(delete)_16x16.gif" onclick="javascript:changeState('<%=systemDict.getId()%>');"
               alt="删除" /><%} %>
                </td>
            </tr>
             <%}}else{ %>
             <tr class="dg_alternatingitemstyle">
                <td colspan="4" align="center"><font color="red">没有找到记录</font></td> 
            </tr> 
            <%} %>
        </table>
        <div class="dg_pagerstyle" align="right">
        <%=pageUtil.getPageStr()%>
        </div>
    </div>
  </body>
</html>
